<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <p>您好，</p>
  <p class='br'>您提交的{applyType}申请已{result}，请知悉；</p>
  <pre style="background-color:lightgray;"><code  >客户名称：{company}
    CDBID：{cdbid}
    审批备注：{reason}
    
    如有疑问可与BU运营联系确认。</code></pre>
  <p><br></p>

  <style>.br {background-color:red;}</style>
  <script>
    channel = new BroadcastChannel("dadadasdad");

    channel.addEventListener("message", (e) => {
      console.log("2", e)
    })
    channel.addEventListener("message", (e) => {
      console.log("1", e)
    })
    channel.onmessage = (e) => {
      console.log(e)
    }

    channel1 = new MessageChannel();

    channel1.port1.addEventListener("message", (e) => {
      console.log("channel1", e)
    })

    setTimeout(() => {
      // channel.postMessage([123])
      channel1.port2.postMessage([123])
    }, 2000);

    const test = () => {
      for (let index = 0; index < 10; index++) {
        if (index === 5) {
          return 2;
        }

      }
      return 5
    }
    console.log(test())


    const arr = [1, 2, 3, 4, 5];

    // arr.forEach((item, index) => {
    //   if (index > 2) {
    //     arr.splice(index, 1)
    //   }
    //   console.log(" index === ", index)
    // })
    const len = arr.length
    for (let index = 0; index < len; index++) {
      if (index > 2) {
        arr.splice(index, 1)
        console.log(" arr === ", arr)
      }
      console.log(" index === ", index)
    }
  </script>
</body>

</html>